<script>
import DB from '@/utils/sqldb.js';
export default {
	data() {
		return {
			timer: null
		};
	},
	onLaunch: function () {
		console.log('App Launch');
	},
	onShow: function () {
		console.log('App Show');
		// setInterval(() => {
		// 	this.lockAPP();
		// }, 1000);
		// #ifdef APP-PLUS
		if (!DB.isOpen()) {
			DB.openSqlite().then(
				(res) => {
					console.log(res, '存在数据库');
				},
				(err) => {
					console.log(err, '不存在数据库');
				}
			);
		}
		// #endif
	},
	onHide: function () {
		console.log('App Hide');
		// clearInterval(this.timer);
		DB.closeSqlite();
	},
	methods: {
		lockAPP() {
			let ndate = Date.parse(new Date());
			let odate = Date.parse(new Date('2024-08-23 17:30:00'));
			if (odate > ndate) {
			} else {
				uni.showLoading({
					title: '试用到期',
					mask: true
				});
				// clearInterval(this.timer);
			}
		}
	}
};
</script>

<style lang="scss">
@import '@/uni_modules/uview-ui/index.scss';
@function tovmin($rpx) {
	//$rpx为需要转换的字号
	@return #{$rpx * 100 / 750}vmin;
}

/*每个页面公共css */
.content {
	width: 100vw;
	min-height: 100vh;
	background: #ffffff;
}

view,
input,
text {
	box-sizing: border-box;
}

@font-face {
	font-family: 'YouSheBiaoTiHei';
	src: url('static/YOUSHEBIAOTIHEI-2.TTF') format('truetype');
}
@font-face {
	font-family: 'heiti';
	src: url('static/fonts/simhei.ttf') format('truetype');
}
@font-face {
	font-family: 'kaiti';
	src: url('static/fonts/simkai.ttf') format('truetype');
}
</style>
